﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RFIDStockManagement.IDAL;
using RFIDStockManagement.Common.Public.Enums;

namespace RFIDStockManagement.DAL
{
    public static class DalFactory
    {
        /// <summary>
        /// 创建用户访问层
        /// </summary>
        /// <returns></returns>
        public static IUserAccess CreateUserAccess()
        {
            return new UserAccess();
        }

        /// <summary>
        /// 创建基础资料访问层
        /// </summary>
        /// <returns></returns>
        public static IBasicInfoAccess CreateBasicInfoAccess(EnumBasicInfo enumBasicInfo)
        {
            IBasicInfoAccess result = null;
            switch (enumBasicInfo)
            {
                case EnumBasicInfo.Supplier:
                    result = new SupplierAccess();
                    break;
                case EnumBasicInfo.Item:
                    result = new ItemAccess();
                    break;
                case EnumBasicInfo.Stock:
                    result = new StockAccess();
                    break;
                case EnumBasicInfo.StockPlace:
                    result = new StockPlaceAccess();
                    break;
                case EnumBasicInfo.MeasureGroup:
                    result = new MeasureGroupAccess();
                    break;
                case EnumBasicInfo.Measure:
                    result = new MeasureAccess();
                    break;
                default:
                    break;
            }

            return result;
        }

        public static ICheckDB CreateCheckDB()
        {
            return new CheckDB();
        }

        public static IInStockBill CreateInstockbillAcess()
        {
            return new InStockBillAcess();
        }

        /// <summary>
        /// 创建一个出库单访问层
        /// </summary>
        /// <returns></returns>
        public static IOutStockBill CreateOutstockbillAcess()
        {
            return new OutStockBillAcess();
        }

        /// <summary>
        /// 创建一个即时库存管理类
        /// </summary>
        /// <returns></returns>
        public static IInventroyManage CreateInventroyManage()
        {
            return new InventoryAccess();
        }

        /// <summary>
        /// 创建一个出库复核访问层
        /// </summary>
        /// <returns></returns>
        public static IOutStockCheck CreateOutStockChecker()
        {
            return new OutStockCheck();
        }

        /// <summary>
        /// 创建一个盘点访问层
        /// </summary>
        /// <returns></returns>
        public static IStockCheck CreateStockCheckAcess()
        {
            return new StockCheckAcess();
        }

        /// <summary>
        /// 创建一个生成rfid的访问层
        /// </summary>
        /// <returns></returns>
        public static IMakeItemRfid CreateMakeItemRfidAcess()
        {
            return new MakeItemRfidAccess();
        }


        /// <summary>
        /// 创建一个生成rfid的访问层
        /// </summary>
        /// <returns></returns>
        public static IIOStock CreateIOStockAccess()
        {
            return new IOStockAccess();
        }
    }
}
